package com.jrfid.smartcabinet.demo.ui.taking

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.navArgs
import com.jrfid.smartcabinet.demo.R
import com.jrfid.smartcabinet.demo.base.BaseFragment
import com.jrfid.smartcabinet.demo.databinding.TakingFragmentBinding
import com.jrfid.smartcabinet.demo.ui.take_or_add.TakeOrAddGoodsFragmentArgs

class TakingFragment : BaseFragment<TakingFragmentBinding, TakingViewModel>(TakingViewModel::class.java) {

    companion object {
        fun newInstance() = TakingFragment()
    }

    override fun getLayoutId(): Int = R.layout.taking_fragment

    private val args by navArgs<TakingFragmentArgs>()

    override fun setData() {
        val isTake = args.isTake
        val tagInfoArray = args.tagInfoArray
        val cabinetArray = args.cabinetArray
        getViewModel()?.setData(isTake, tagInfoArray, cabinetArray)
    }

}